﻿using Common.DTO;
using Database.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlayerLogic
{
    public class UserAccountManager
    {
        private readonly UserAccountRepository _userAccountRepository;

        public UserAccountManager()
        {
            _userAccountRepository = new UserAccountRepository();
        }

        public UserAccountDTO Get(Guid id)
        {
            var userAccount = _userAccountRepository.Read(id);
            return userAccount;
        }
    
        public Guid New(UserAccountDTO userAccount)
        {
            var guid = _userAccountRepository.Create(userAccount);
            return guid;
        }

        public bool Change(UserAccountDTO userAccount)
        {
            // TODO_OL: Check password

            var result = _userAccountRepository.Update(userAccount);
            return result;
        }

        public bool Remove(Guid id)
        {
            // TODO_OL: Check password

            var result = _userAccountRepository.Delete(id);
            return result;
        }
    }
}
